/* =====================================================================
   EL BOMBO (src/train/drum3d.js) — el vagón restaurante del Boreal.
   Art déco ferroviario: cartón, latón, terciopelo burdeos, verde botella.
   Todo lo que se ve tiene su estado final visible; las animaciones van con
   `backwards` (con «Animación: Ninguna» nada se queda invisible).
   ===================================================================== */
#panelBowl.is-drum > :not(.drum-room) { display: none !important; }

.drum-room {
    --brass: #d2a64e; --brass-d: #8a6526; --card: #efe6cf; --ink: #2a1c10; --velvet: #5a0f1a; --bottle: #0f5a35;
    position: relative; width: 100%; height: min(78vh, 760px); min-height: 420px;
    overflow: hidden; border-radius: 14px; background: #1a1410;
    box-shadow: inset 0 0 0 1px rgba(210,166,78,.35), 0 14px 40px rgba(0,0,0,.45);
    font-family: Georgia, "Times New Roman", serif; color: var(--card);
    user-select: none;
}
.drum-room[hidden] { display: none; }
.drum-host, .drum-host canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* escarcha en las esquinas (el vagón no está caliente del todo) */
.drum-frost {
    position: absolute; inset: 0; pointer-events: none;
    background:
        radial-gradient(120% 70% at 0% 0%, rgba(220,235,250,.22), transparent 38%),
        radial-gradient(120% 70% at 100% 0%, rgba(220,235,250,.18), transparent 36%),
        radial-gradient(140% 90% at 50% 120%, rgba(0,0,0,.55), transparent 55%);
}

/* cabecera: placa de latón */
.drum-top {
    position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 14px; align-items: center; padding: 7px 18px;
    background: linear-gradient(#e4be6c, #a77c2e); color: #2a1a06; border-radius: 4px;
    box-shadow: 0 0 0 2px #5c3d10, 0 0 0 4px #d2a64e, 0 6px 16px rgba(0,0,0,.5);
    letter-spacing: .12em; text-transform: uppercase; font-size: 12px; white-space: nowrap;
}
.drum-kicker { font-weight: bold; }
.drum-place { opacity: .8; }
.drum-sway { padding-left: 12px; border-left: 1px solid rgba(42,26,6,.4); font-weight: bold; letter-spacing: .04em; }

/* subtítulo: quién pica y qué dice */
.drum-caption {
    position: absolute; left: 50%; bottom: 92px; transform: translateX(-50%);
    max-width: min(720px, 92%); text-align: center; padding: 10px 18px;
    background: rgba(20,12,8,.72); border: 1px solid rgba(210,166,78,.4); border-radius: 8px;
    opacity: 0; transition: opacity .25s;
}
.drum-caption.is-on { opacity: 1; }
.drum-who { display: block; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--brass); }
.drum-who b { color: var(--c, var(--brass)); }
.drum-line { display: block; font-style: italic; font-size: 17px; line-height: 1.35; margin-top: 3px; }
.drum-line:empty { display: none; }

/* los tres billetes en pequeño, arriba a la izquierda */
.drum-strip { position: absolute; top: 62px; left: 14px; display: flex; flex-direction: column; gap: 6px; }
.drum-chip {
    display: grid; min-width: 170px; max-width: 240px; padding: 6px 12px 6px 16px; position: relative;
    background: var(--card); color: var(--ink); border-radius: 4px;
    box-shadow: 0 3px 10px rgba(0,0,0,.4); border-left: 6px solid var(--c, var(--brass-d));
    transform: translateX(0); animation: drumChipIn .35s ease-out backwards;
}
.drum-chip small { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; opacity: .7; }
.drum-chip b { font-size: 16px; font-family: "Segoe Script", "Brush Script MT", cursive; font-style: italic; color: #1b2340; }
.drum-chip-car b { font-family: Georgia, serif; font-style: normal; color: var(--ink); }
.drum-chip i { font-size: 11px; font-style: normal; }
.drum-chip.band-frozen { border-left-color: #7fb4e6; } .drum-chip.band-cold { border-left-color: #a9cbe8; }
.drum-chip.band-mild { border-left-color: #e3c27a; } .drum-chip.band-warm { border-left-color: #e5964a; } .drum-chip.band-torrid { border-left-color: #d4552c; }
@keyframes drumChipIn { from { transform: translateX(-30px); opacity: 0; } }

/* el botón: un billete grande */
.drum-foot { position: absolute; left: 0; right: 0; bottom: 18px; display: flex; justify-content: center; }
.drum-draw {
    display: grid; gap: 2px; padding: 12px 38px; min-width: 240px; cursor: pointer;
    background: var(--card); color: var(--ink); border: 0; border-radius: 6px; font-family: inherit;
    box-shadow: 0 0 0 2px var(--ink) inset, 0 0 0 5px var(--card) inset, 0 0 0 6px rgba(42,28,16,.6) inset, 0 8px 22px rgba(0,0,0,.5);
    transition: transform .15s, filter .15s;
}
.drum-draw-txt { font-size: 19px; font-weight: bold; letter-spacing: .08em; text-transform: uppercase; }
.drum-draw-sub { font-size: 12px; font-style: italic; opacity: .75; }
.drum-draw:hover:not(:disabled) { transform: translateY(-2px) rotate(-.6deg); }
.drum-draw:disabled { filter: saturate(.3) brightness(.75); cursor: default; }
.drum-room.is-drawing .drum-foot { opacity: 0; pointer-events: none; transition: opacity .3s; }

.drum-skip { position: absolute; right: 16px; bottom: 16px; font-size: 12px; font-style: italic; opacity: 0; pointer-events: none; color: rgba(239,230,207,.7); }
.drum-room.is-drawing .drum-skip { opacity: 1; }
.drum-room.is-skipping .drum-skip { opacity: 0; }

/* la Influencia: tarjeta de cartón con tres botones */
.drum-choice { position: absolute; inset: auto 0 18px 0; display: flex; justify-content: center; padding: 0 12px; }
.drum-choice[hidden] { display: none; }
.drum-choice-card {
    width: min(760px, 100%); padding: 14px 16px 16px; background: rgba(239,230,207,.97); color: var(--ink);
    border-radius: 8px; box-shadow: 0 0 0 2px var(--ink) inset, 0 12px 30px rgba(0,0,0,.55);
    animation: drumChoiceIn .3s ease-out backwards;
}
@keyframes drumChoiceIn { from { transform: translateY(24px); opacity: 0; } }
.drum-choice-title { text-align: center; font-size: 19px; margin-bottom: 4px; }
.drum-choice-title b { color: var(--c, var(--ink)); filter: brightness(.6) saturate(1.4); }
.drum-choice-title em { font-style: normal; font-weight: bold; }
.drum-choice-warn { text-align: center; font-size: 13px; font-style: italic; color: #2a5a8a; margin-bottom: 4px; }
.drum-choice-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.drum-opt {
    display: grid; gap: 3px; padding: 10px 8px; cursor: pointer; text-align: center; font-family: inherit;
    background: #f7f0de; color: var(--ink); border: 1px solid rgba(42,28,16,.5); border-radius: 5px;
    transition: transform .12s, background .12s;
}
.drum-opt b { font-size: 15px; }
.drum-opt small { font-size: 12px; opacity: .78; }
.drum-opt:hover:not(:disabled) { background: #fff8e6; transform: translateY(-2px); }
.drum-opt:disabled { opacity: .45; cursor: default; }
.drum-opt-keep { background: var(--bottle); color: #f3eee2; border-color: #082e1b; }
.drum-opt-keep:hover:not(:disabled) { background: #13704a; }
.drum-opt-back { margin: 10px auto 0; display: block; padding: 7px 22px; }
.drum-pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 10px; max-height: 42vh; overflow: auto; }
.drum-pick {
    display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center;
    padding: 7px 9px; cursor: pointer; text-align: left; font-family: inherit; color: var(--ink);
    background: #f7f0de; border: 1px solid rgba(42,28,16,.45); border-left: 6px solid #e3c27a; border-radius: 4px;
}
.drum-pick span { grid-row: span 2; font-size: 20px; font-weight: bold; opacity: .55; }
.drum-pick b { font-size: 14px; } .drum-pick i { font-size: 11px; font-style: normal; opacity: .8; }
.drum-pick:hover { background: #fff8e6; }
.drum-pick.band-frozen { border-left-color: #7fb4e6; } .drum-pick.band-cold { border-left-color: #a9cbe8; }
.drum-pick.band-warm { border-left-color: #e5964a; } .drum-pick.band-torrid { border-left-color: #d4552c; }

/* sin 3D: una estampa */
.drum-room.is-still { background: radial-gradient(ellipse at 50% 70%, #4a2a18, #140c08); }
.drum-room.is-still .drum-host { display: none; }

/* la cortina de carga: un billete grande y la barra de latón */
.drum-curtain {
    position: absolute; inset: 0; display: grid; place-items: center; z-index: 5;
    background: radial-gradient(ellipse at 50% 40%, #3a2416, #120a06 70%);
    opacity: 0; pointer-events: none; transition: opacity .45s ease;
}
.drum-curtain.is-on { opacity: 1; pointer-events: auto; }
.drum-curtain-in { display: grid; justify-items: center; gap: 14px; width: min(380px, 80%); }
.drum-curtain-ticket {
    width: 220px; height: 104px; display: grid; place-items: center; position: relative;
    background: var(--card); color: var(--ink); border-radius: 8px;
    box-shadow: 0 0 0 2px var(--ink) inset, 0 0 0 6px var(--card) inset, 0 0 0 7px rgba(42,28,16,.5) inset, 0 10px 30px rgba(0,0,0,.6);
    animation: drumSway 2.3s ease-in-out infinite;
}
.drum-curtain-ticket b { letter-spacing: .5em; font-size: 22px; padding-left: .5em; }
.drum-curtain-ticket i {
    position: absolute; left: 24px; top: 50%; width: 22px; height: 22px; margin-top: -11px; background: #120a06;
    clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}
@keyframes drumSway { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg) translateY(-3px); } }
.drum-curtain-title { font-style: italic; color: var(--card); text-align: center; }
.drum-bar { width: 100%; height: 8px; border-radius: 4px; background: rgba(0,0,0,.5); box-shadow: 0 0 0 1px var(--brass-d); overflow: hidden; }
.drum-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brass-d), var(--brass)); transition: width .3s ease; }
.drum-curtain-sub { font-size: 12px; opacity: .6; min-height: 1em; }

@media (max-width: 640px) {
    .drum-room { height: 74vh; }
    .drum-top { font-size: 10px; gap: 8px; padding: 6px 10px; }
    .drum-place { display: none; }
    .drum-strip { top: 54px; left: 8px; } .drum-chip { min-width: 130px; }
    .drum-chip b { font-size: 13px; }
    .drum-choice-row { grid-template-columns: 1fr; }
    .drum-caption { bottom: 84px; } .drum-line { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) { .drum-curtain-ticket { animation: none; } }

/* la pestaña, cuando es del tren */
.tab-btn.tab-drum { font-variant: small-caps; }

/* el primer billete del prólogo (DR.ceremony): la misma sala, a pantalla entera, sin botones */
.vh-drum { position: absolute; inset: 0; z-index: 5; }
.vh-drum[hidden] { display: none; }
.vh-drum .drum-room { height: 100%; min-height: 0; border-radius: 0; box-shadow: none; }
.drum-room.is-ceremony .drum-foot, .drum-room.is-ceremony .drum-sway, .drum-room.is-ceremony .drum-choice { display: none !important; }
